{% extends 'base.html' %} 
{% block title %}QEB财务管理———支出明细{% endblock %}

{% block Navigation %}
<div class="carousel slide" id="carousel-176804" style="margin:55px 0;">
<ul class="nav nav-tabs" >
  <!-- <li style="background-color: aqua;"><a href="/teacher" style="font-size: larger;color: rgb(243, 8, 8);">教师管理</a></li> -->
    
    <li class="active" style="color: rgb(255,255,255)"><a href="{% url 'expenditure' %}">支出明细</a></li>
    <li  style="color: rgb(255,255,255)"><a href="{% url 'income' %}">收入明细</a></li>
    <li style="color: rgb(255,255,255)"><a href="#">课时提成</a></li>
    <li style="color: rgb(255,255,255)"><a href="#">工作核算</a></li>
    
</ul>
<div class="panel panel-info">
  <div class="panel-body">

    <div class="col-sm-4">
      <div class="form-group" style="float: left;">
          <form role="searchs" method="POST" id="searchform" >
              {% csrf_token %}   
                  <input type="search" name="year"  placeholder={{ year }} required  value={{year}}>
                  <input type="search" name="month"  placeholder="查看月份" required > 
              <button type="submit" name="search" class="glyphicon glyphicon-search  btn btn-warning" >搜索</button>
            
          </form>  
      </div>

      <div class="form-group" style="float: right;">
          <form role="searchs" method="POST" id="searchform" >
              {% csrf_token %} 
              <button type="submit" name="add" class="glyphicon glyphicon-plus btn btn-success ">新增费用</button>
                                    
          </form>
      </div>                      

    </div>
  </div>
</div>

<div style="width: 100%; text-align: center">
  <h1>{{ year }}年{{ month }}月支出明细</h1>
</div>

<table class="table table-bordered">
  <thead>
    <tr>
      <th style="background-color: rgb(245, 189, 11)">
        <font color="#fff">名称</font>
      </th>
      <th style="background-color: rgb(245, 189, 11)">
        <font color="#fff">金额(元)</font>
      </th>
      <th style="background-color: rgb(245, 189, 11)">
        <font color="#fff">备注</font>
      </th>
      <th style="background-color: rgb(245, 189, 11)">
        <font color="#fff">操作</font>
      </th>
    </tr>
  </thead>

  <tbody>
    {% for expenditure in expenditures %}
    <tr class="active danger">
      <th style="background-color: rgb(245, 189, 11)">
        <font color="#fff">{{ expenditure.name }}</font>
      </th>
      <th>{{expenditure.money}}</th>
      <th>{{expenditure.remarks}}</th>
      <th>
        <a href="/finance/expenditure_example/{{ expenditure.id }}">编辑</a>
      </th>
    </tr>
    {% endfor %}

    <tr class="active danger">
      <th style="background-color: rgb(245, 189, 11)">
        <font color="#fff">合计</font>
      </th>
      <th style="color: fuchsia">{{ total }}</th>
      <th></th>
      <th></th>
    </tr>
  </tbody>
</table>
</div>
{% endblock Navigation %}
